﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="News.HubPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:News"
    xmlns:data="using:News.Data"
    xmlns:tiles="using:News.VariableTemplate"
    xmlns:common="using:News.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    
    <Page.TopAppBar>
        <AppBar x:Name="TopApp" Background="#FF2D2D2D">
            <Grid Height="140">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,0">
                    <Button x:Name="Home" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="0,0,5,0">
                        <Grid x:Name="grid" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarHome.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                    <Button x:Name="India" Click="World_Clicked" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="5,0">
                        <Grid x:Name="grid1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image1" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarIndia.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                    <Button x:Name="World" Click="World_Clicked" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="5,0">
                        <Grid x:Name="grid2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image2" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarWorld.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                    <Button x:Name="EditorsPick" Click="World_Clicked" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="5,0">
                        <Grid x:Name="grid3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image3" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarEditorsPick.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                    <Button x:Name="Business" Click="World_Clicked" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="5,0">
                        <Grid x:Name="grid4" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image4" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarBusiness.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                    <Button x:Name="Editorial" Click="World_Clicked" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="5,0">
                        <Grid x:Name="grid5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image5" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarEditorial.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                    <Button x:Name="arts" Click="World_Clicked" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="5,0">
                        <Grid x:Name="grid6" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image6" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarArts.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                    <Button x:Name="Threads" Click="World_Clicked" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Style="{StaticResource AppBarBtnStyle}" Margin="5,0">
                        <Grid x:Name="grid7" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0">
                            <Image x:Name="image7" HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/Images/AppBar/AppBarThreads.png" Margin="0,6,0,0" Width="86" Height="87"/>
                        </Grid>
                    </Button>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.TopAppBar>

    <Page.Resources>

        <!--
            Collection of grouped items displayed by this page, bound to a subset
            of the complete item list because items in groups cannot be virtualized
        -->
        <CollectionViewSource
            x:Name="groupedItemsViewSource"
            Source="{Binding Groups}"
            IsSourceGrouped="true"
            ItemsPath="TopItems"
            d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:HubPageDataSource, IsDesignTimeCreatable=True}}"/>

        <CollectionViewSource
            x:Name="groupedItemsViewSource2"
            Source="{Binding Groups2}"
            IsSourceGrouped="true"
            ItemsPath="TopItems"
            d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:SemanticDataSource, IsDesignTimeCreatable=True}}"/>



        <tiles:VariableTiles x:Name="MyTemplates"
                             SmallTemplate="{StaticResource SmallTemplate}"
                             BigTemplate="{StaticResource BigTemplate}"
                             LengthyTemplate="{StaticResource LengthyTemplate}"
                             WideTemplate="{StaticResource WideTemplate}"
                             SquareTemplate="{StaticResource SquareTemplate}"
                             NormalTemplate="{StaticResource NormalTemplate}"
                             SemanticsBigTemplate ="{StaticResource SemanticsBigTemplate}"
                             SemanticsSmallTemplate="{StaticResource SemanticsSmallTemplate}">
            
        </tiles:VariableTiles>


        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">App Slogan Goes Here</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}">
    	<Grid.Background>
    		<ImageBrush ImageSource="Assets/Images/Background.jpg" Stretch="UniformToFill"/>
    	</Grid.Background>    
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Horizontal scrolling grid used in most view states -->
        
        <!-- Vertical scrolling list only used when snapped -->
        
<!-- Vertical scrolling list only used when snapped -->
        <ScrollViewer x:Name="scrollViewer" Grid.RowSpan="2" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalScrollMode="Disabled" ZoomMode="Disabled" Style="{StaticResource HorizontalScrollViewerStyle}">
            <Grid MaxWidth="4600" >                
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="auto"/>
    				<ColumnDefinition Width="*"/>
    			</Grid.ColumnDefinitions>
    			<Grid.RowDefinitions>
    				<RowDefinition Height="140"/>
    				<RowDefinition Height="*"/>
    			</Grid.RowDefinitions>
                <StackPanel Grid.RowSpan="2">
                    <FlipView Grid.RowSpan="2" Style="{StaticResource FlipViewStyle1}" Width="700" SelectedIndex="1">
                	<Image Source="Assets/Images/HubPage/HubPageBanner.jpg" Stretch="UniformToFill"/>
                	<Image Source="Assets/Images/HubPage/HubPageBanner.jpg" Stretch="UniformToFill"/>
                	<Image Source="Assets/Images/HubPage/HubPageBanner.jpg" Stretch="UniformToFill"/>
                    </FlipView>
                </StackPanel>
                <Image Source="Assets/Images/HubPage/BannerTopShadow.png" Stretch="Fill"/>
    			<SemanticZoom x:Name="Zoom" Grid.Column="1" Grid.Row="1" Style="{StaticResource SemanticZoomStyle}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollMode="Disabled" Padding="40,3,3,3" ViewChangeStarted="Zoom_ViewChangeStarted_1">
    				<SemanticZoom.ZoomedInView>        
    					<tiles:VariableTileControl
    						x:Name="itemGridView" 
    						AutomationProperties.AutomationId="itemGridView"
    						AutomationProperties.Name="Grouped Items"
    						ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
    						ItemTemplateSelector="{StaticResource MyTemplates}"
    						SelectionMode="None" IsItemClickEnabled="True" ItemClick="itemGridView_ItemClick_1"
    						IsSwipeEnabled="false">

    						<tiles:VariableTileControl.ItemsPanel>
    							<ItemsPanelTemplate>                        
    								<VirtualizingStackPanel Orientation="Horizontal"/>
    							</ItemsPanelTemplate>
    						</tiles:VariableTileControl.ItemsPanel>
    						<tiles:VariableTileControl.GroupStyle>
    							<GroupStyle>
    								<GroupStyle.HeaderTemplate>
    									<DataTemplate>
    										<Grid Margin="1,0,0,6">
    											<Button Click="Button_Click_1"
    												AutomationProperties.Name="Group Title"
    												Style="{StaticResource TextPrimaryButtonStyle}">
    												<StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="{Binding Title}" Foreground="{Binding GHcolor}" Margin="3,-7,10,10" Style="{StaticResource GroupHeaderTextStyle}" />
                                                        <TextBlock Text="{StaticResource ChevronGlyph}" Foreground="#FFaaaaaa" FontFamily="Segoe UI Symbol" Margin="0,-7,0,10" Style="{StaticResource GroupHeaderTextStyle}"/>
    												</StackPanel>
    											</Button>
    										</Grid>
    									</DataTemplate>
    								</GroupStyle.HeaderTemplate>
    								<GroupStyle.Panel>
    									<ItemsPanelTemplate>
                                            <VariableSizedWrapGrid Background="{Binding GroupBg}" ItemHeight="10" ItemWidth="10" Orientation="Vertical" Margin="0,0,80,80"/>
    									</ItemsPanelTemplate>
    								</GroupStyle.Panel>
    							</GroupStyle>
    						</tiles:VariableTileControl.GroupStyle>
    					</tiles:VariableTileControl>
    				</SemanticZoom.ZoomedInView>            
    				<SemanticZoom.ZoomedOutView>
                        <tiles:VariableTileControl
    						x:Name="itemGridView2"
    						AutomationProperties.AutomationId="itemGridView"
    						AutomationProperties.Name="Grouped Items"          
    						Padding="80,0,0,80"
    						ItemsSource="{Binding Source={StaticResource groupedItemsViewSource2}}"
    						ItemTemplateSelector="{StaticResource MyTemplates}"
    						SelectionMode="None"
    						IsSwipeEnabled="false" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Left">

                            <tiles:VariableTileControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <VirtualizingStackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </tiles:VariableTileControl.ItemsPanel>
                            <tiles:VariableTileControl.GroupStyle>
                                <GroupStyle>
                                    <GroupStyle.HeaderTemplate>
                                        <DataTemplate>
                                            <Grid Margin="1,0,0,6">
                                                <Button
    												AutomationProperties.Name="Group Title"
    												Style="{StaticResource TextPrimaryButtonStyle}">
                                                    <StackPanel Orientation="Horizontal"/>
                                                </Button>
                                            </Grid>
                                        </DataTemplate>
                                    </GroupStyle.HeaderTemplate>
                                    <GroupStyle.Panel>
                                        <ItemsPanelTemplate>
                                            <VariableSizedWrapGrid ItemHeight="10" ItemWidth="10" Orientation="Vertical" Margin="0,0,80,0"/>
                                        </ItemsPanelTemplate>
                                    </GroupStyle.Panel>
                                </GroupStyle>
                            </tiles:VariableTileControl.GroupStyle>
                        </tiles:VariableTileControl>
                    </SemanticZoom.ZoomedOutView>
    			</SemanticZoom>
                <Grid Height="260" VerticalAlignment="Bottom" Grid.Row="1">
                	<Grid.ColumnDefinitions>
                		<ColumnDefinition Width="10"/>
                		<ColumnDefinition/>
                		<ColumnDefinition Width="300"/>
                	</Grid.ColumnDefinitions>
                	<Path Data="M0,0 L702,260 L0,260 z" Fill="#7FFF383A" Stretch="Fill" UseLayoutRounding="False" Grid.ColumnSpan="3"/>
                	<StackPanel HorizontalAlignment="Left" Width="350" Grid.Column="1" VerticalAlignment="Bottom" Margin="0,0,0,20">
                		<TextBlock TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit" FontFamily="Segoe UI" FontSize="26"/>
                		<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                			<TextBlock TextWrapping="Wrap" Text="Business" FontFamily="Segoe UI" FontSize="26" Foreground="#FFE0E0E0" FontWeight="Bold"/>
                			<TextBlock TextWrapping="Wrap" Text="Dec 16, 2012 | Lorem Ipsum" FontFamily="Segoe UI" FontSize="18" Foreground="#FFE0E0E0" VerticalAlignment="Bottom" Margin="5,0,0,2"/>
                		</StackPanel>
                	</StackPanel>
                </Grid>        
    		</Grid>
        </ScrollViewer>
    	
        
<!-- Vertical scrolling list only used when snapped -->
    	<ListView
    		x:Name="itemListView"
    		AutomationProperties.AutomationId="ItemListView"
    		AutomationProperties.Name="Grouped Items"
    		Visibility="Collapsed"
    		Margin="0,130,0,0"
    		Padding="10,0,0,60"
    		ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
    		ItemTemplate="{StaticResource Standard80ItemTemplate}"
    		SelectionMode="None" IsItemClickEnabled="True" ItemClick="itemGridView_ItemClick_1"
    		IsSwipeEnabled="false" Grid.ColumnSpan="2" Grid.RowSpan="2">

    		<ListView.GroupStyle>
    			<GroupStyle>
    				<GroupStyle.HeaderTemplate>
    					<DataTemplate>
    						<Grid Margin="7,7,0,0">
    							<Button Click="Button_Click_1"
    								AutomationProperties.Name="Group Title"
    								Style="{StaticResource TextPrimaryButtonStyle}">
    								<StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Title}" Margin="3,-7,10,10" Foreground="#FFff3739" Style="{StaticResource GroupHeaderTextStyle}" />
                                        <TextBlock Text="{StaticResource ChevronGlyph}"  Foreground="#FFaaaaaa" FontFamily="Segoe UI Symbol" Margin="0,-7,0,10" Style="{StaticResource GroupHeaderTextStyle}"/>
    								</StackPanel>
    							</Button>
    						</Grid>
    					</DataTemplate>
    				</GroupStyle.HeaderTemplate>
    			</GroupStyle>
    		</ListView.GroupStyle>
    	</ListView>

<!-- Back button and page title -->
    	<Grid Grid.ColumnSpan="2">
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="Auto"/>
    			<ColumnDefinition/>
    			<ColumnDefinition Width="Auto"/>
    		</Grid.ColumnDefinitions>
    		<Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}" VerticalAlignment="Center" Margin="36,0"/>
    		<TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" Grid.Column="1" IsHitTestVisible="false" Style="{StaticResource PageHeaderTextStyle}" Foreground="#FF999797" VerticalAlignment="Bottom" Height="50"/>
    		<Image x:Name="image8" Grid.Column="2" Source="Assets/AppLogo.png" HorizontalAlignment="Right" Margin="0,0,20,0" Width="200"/>
    	</Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image1">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image2">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image3">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image4">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image5">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image6">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="image7">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>70</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image1">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image2">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image3">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image4">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image5">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image6">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="image7">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>71</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>

                    </Storyboard>
                </VisualState>

                <!--
                    The back button and title have different styles when snapped, and the list representation is substituted
                    for the grid displayed in all other view states
                -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>

                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="scrollViewer">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Visibility>Collapsed</Visibility>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TopApp">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Visibility>Collapsed</Visibility>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="backButton">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Thickness>36,36,36,0</Thickness>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    	<DoubleAnimation Duration="0" To="40" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="pageTitle" d:IsOptimized="True"/>
                    	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="pageTitle">
                    		<DiscreteObjectKeyFrame KeyTime="0">
                    			<DiscreteObjectKeyFrame.Value>
                    				<Visibility>Collapsed</Visibility>
                    			</DiscreteObjectKeyFrame.Value>
                    		</DiscreteObjectKeyFrame>
                    	</ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
